import { IPSDEFDCatGroupLogic } from './ipsdefdcat-group-logic';
import { PSDEFDGroupLogicImpl } from './psdefdgroup-logic-impl';

export class PSDEFDCatGroupLogicImpl extends PSDEFDGroupLogicImpl implements IPSDEFDCatGroupLogic {
  get logicCat(): 'PANELVISIBLE' | 'ITEMENABLE' | 'ITEMBLANK' | 'SCRIPTCODE_CHANGE' | 'SCRIPTCODE_CLICK' | 'SCRIPTCODE_FOCUS' | 'SCRIPTCODE_BLUR' {
    return this.M.logicCat;
  }

  protected relateddetailnames: string[] | null = null;

  getRelatedDetailNames(): string[] | null {
    if (this.relateddetailnames == null) {
      const value = this.M.relatedDetailNames;
      if (value == null) {
        return null;
      }
      const arrayNode: any[] = value;
      if (arrayNode.length == 0) {
        return null;
      }
      const list: string[] = [];
      for (let i = 0; i < arrayNode.length; i++) {
        list.push(arrayNode[i]);
      }
      this.relateddetailnames = list;
    }
    return this.relateddetailnames.length == 0 ? null : this.relateddetailnames;
  }

  get relatedDetailNames(): string[] | null {
    return this.getRelatedDetailNames();
  }

  get scriptCode(): string {
    return this.M.scriptCode;
  }

  get cls(): string {
    return 'PSDEFDCatGroupLogicImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'control.form.IPSDEFDCatGroupLogic') return true;
    return super.instanceof(cls);
  }
}
